package com.example.movie.utils

/**
 * @author zhaoren
 */
object CollectionUtils {

    private const val LOAD_FACTORY = 0.75

    fun getHashMapCapacity(size: Int): Int {
        var i = 0
        var cur = 2
        while (true) {
            cur = Math.pow(2.0, i.toDouble()).toInt()
            if (cur * LOAD_FACTORY >= size) {
                return cur
            }
            i++
        }
    }
}